	<?if($students AND !empty($students)):?>
		<div class="dataset">
		<?foreach($students as $dk => $dv):?>
			<?foreach($dv as $dvk => $dvv):?>
				<h3><?=strtoupper($dvk);?></h3>
				<div style="padding:0;margin:0;">
					<table class="table table-bordered">
					<thead>
						<tr>
							<th>ID No</th>
							<th>Block</th>
							<th>Student Name</th>
							<th>Gender</th>
							
							<th>Age</th>
							<th>Date of Birth</th>
							
							<th>&nbsp;</th>
						</tr>
					</thead>
					<tbody>
						<?if(!empty($dvv['students'])):?>
							<?foreach($dvv['students'] as $dvvk => $dvvv):?>
							<?$stat = isset($dvvv->registrar_approved) ? $dvvv->registrar_approved == 0 ? '#f00;' : '' : '';?>
								<tr>
									<td><?=ucwords($dvvv->idno);?></td>
									<td class="for-block"><?=ucwords($dvvv->block_name);?></td>
									<td style="font-weight:bold;font-size:12px;">
										<a href="<?=site_url('profile/student/'.$dvvv->enrollment_id);?>" style="color:<?=$stat;?>" target="_blank"><?=ucwords(strtolower($dvvv->fullname));?></a>
									</td>
									<td><?=ucwords($dvvv->gender);?></td>
									
									<td><?=$dvvv->age;?></td>
									<td class="for-doc"><?=$dvvv->dob;?></td>
									
									<td>
										<?php 
										if(in_array($dvvv->e_profile_id,$enrolled)){
										?>
											<a href="#" class="confirm btn btn-mini btn-info" title="<?=ucwords(strtolower($dvvv->fullname));?> is already enrolled?">Enrolled</a>
										<?php
										}else{
										?>
											<a href="<?=site_url('registrar/early_enrollment_me/'.__link($dvvv->enrollment_id));?>" class="confirm btn btn-mini btn-success" title="Are you sure you want to enroll student <?=ucwords(strtolower($dvvv->fullname));?>?">Enroll</a>
										<?php
										}
										?>
									</td>
								</tr>
							<?endforeach;?>		
						<?else:?>
							<tr class="info">
								<td colspan="9" style="text-align:center;">No Students Found</td>
							</tr>
						<?endif;?>
					</tbody>
					</table>
				</div>
			<?endforeach;?>
		<?endforeach;?>
			</div>
			
	<?else:?>
		<tr class="info">
			<td colspan="9" style="text-align:center;">Admin needs to open a school year for early enrollment to show.</td>
		</tr>
	<?endif;?>
<script>$(document).ready(function(){
  var icons = {
      header: "ui-icon-circle-arrow-e",
      activeHeader: "ui-icon-circle-arrow-s"
    }
  $('.dataset').accordion({
    heightStyle: "content",
    icons:icons});
});</script>